@layout("/common/_curd/_container.html"){

<script type="text/javascript">
	var ctx = "${basePath}";
	var grid_selector = "#grid-table";
	var pager_selector = "#grid-pager";
	
	$(function(){
		initGrid();
		initMenuBtn("btns", "${code}");
	});
	
	function initGrid(){
		var grid_url = ctx + "/${code}/list";
		var _colnames = ["", 
						"用户类型：0=管理员，1=普通用户", 
						"", 
						"", 
						"", 
						"", 
						"", 
						"", 
						"微信openid", 
						"微信用户union id", 
						"昵称", 
						"", 
						"商城id", 
						"是否是分销商 0--不是 1--是 2--申请中", 
						"父级ID", 
						"成为分销商的时间", 
						"累计佣金", 
						"可提现佣金", 
						"是否是核销员 0--不是 1--是", 
						"微擎账户id", 
						"", 
						"会员等级", 
						"用户当前积分", 
						"用户总获得积分", 
						"余额", 
						"联系方式", 
						"备注", 
						"授权手机号", 
						"微信公众号openid", 
						"小程序平台 0 => 微信, 1 => 支付宝", 
						"黑名单 0.否 | 1.是", 
						"可能成为上级的ID"];
		var _colmodel = [{name:"id", index:"id", width:100},
						{name:"type", index:"type", width:100},
						{name:"username", index:"username", width:100},
						{name:"password", index:"password", width:100},
						{name:"auth_key", index:"auth_key", width:100},
						{name:"access_token", index:"access_token", width:100},
						{name:"addtime", index:"addtime", width:100},
						{name:"is_delete", index:"is_delete", width:100},
						{name:"wechat_open_id", index:"wechat_open_id", width:100},
						{name:"wechat_union_id", index:"wechat_union_id", width:100},
						{name:"nickname", index:"nickname", width:100},
						{name:"avatar_url", index:"avatar_url", width:100},
						{name:"store_id", index:"store_id", width:100},
						{name:"is_distributor", index:"is_distributor", width:100},
						{name:"parent_id", index:"parent_id", width:100},
						{name:"time", index:"time", width:100},
						{name:"total_price", index:"total_price", width:100},
						{name:"price", index:"price", width:100},
						{name:"is_clerk", index:"is_clerk", width:100},
						{name:"we7_uid", index:"we7_uid", width:100},
						{name:"shop_id", index:"shop_id", width:100},
						{name:"level", index:"level", width:100},
						{name:"integral", index:"integral", width:100},
						{name:"total_integral", index:"total_integral", width:100},
						{name:"money", index:"money", width:100},
						{name:"contact_way", index:"contact_way", width:100},
						{name:"comments", index:"comments", width:100},
						{name:"binding", index:"binding", width:100},
						{name:"wechat_platform_open_id", index:"wechat_platform_open_id", width:100},
						{name:"platform", index:"platform", width:100},
						{name:"blacklist", index:"blacklist", width:100},
						{name:"parent_user_id", index:"parent_user_id", width:100}];
		
		jQuery(grid_selector).jqGrid({
			url : grid_url,
		    shrinkToFit : true,
			colNames : _colnames,
			colModel : _colmodel, 
			jsonReader : {id :"id"},
			pager : pager_selector,
			postData : {sort : "id", order : "desc"}
		});
	}
</script>


	<!-- 配置 grid -->
	<div class="row">
		<div class="col-xs-12 tb-grid">
			<!-- 配置 查询 -->
			@ var _col=[
@		{name:"", index:"id", type:"text"},
			@		{name:"用户类型：0=管理员，1=普通用户", index:"type", type:"text"},
			@		{name:"", index:"username", type:"text"},
			@		{name:"", index:"password", type:"text"},
			@		{name:"", index:"auth_key", type:"text"},
			@		{name:"", index:"access_token", type:"text"},
			@		{name:"", index:"addtime", type:"text"},
			@		{name:"", index:"is_delete", type:"text"},
			@		{name:"微信openid", index:"wechat_open_id", type:"text"},
			@		{name:"微信用户union id", index:"wechat_union_id", type:"text"},
			@		{name:"昵称", index:"nickname", type:"text"},
			@		{name:"", index:"avatar_url", type:"text"},
			@		{name:"商城id", index:"store_id", type:"text"},
			@		{name:"是否是分销商 0--不是 1--是 2--申请中", index:"is_distributor", type:"text"},
			@		{name:"父级ID", index:"parent_id", type:"text"},
			@		{name:"成为分销商的时间", index:"time", type:"text"},
			@		{name:"累计佣金", index:"total_price", type:"text"},
			@		{name:"可提现佣金", index:"price", type:"text"},
			@		{name:"是否是核销员 0--不是 1--是", index:"is_clerk", type:"text"},
			@		{name:"微擎账户id", index:"we7_uid", type:"text"},
			@		{name:"", index:"shop_id", type:"text"},
			@		{name:"会员等级", index:"level", type:"text"},
			@		{name:"用户当前积分", index:"integral", type:"text"},
			@		{name:"用户总获得积分", index:"total_integral", type:"text"},
			@		{name:"余额", index:"money", type:"text"},
			@		{name:"联系方式", index:"contact_way", type:"text"},
			@		{name:"备注", index:"comments", type:"text"},
			@		{name:"授权手机号", index:"binding", type:"text"},
			@		{name:"微信公众号openid", index:"wechat_platform_open_id", type:"text"},
			@		{name:"小程序平台 0 => 微信, 1 => 支付宝", index:"platform", type:"text"},
			@		{name:"黑名单 0.否 | 1.是", index:"blacklist", type:"text"},
			@		{name:"可能成为上级的ID", index:"parent_user_id", type:"text"}							
			@];
			@ include("/common/_function/_search.html",{"col":_col}){}
			<!-- 按钮 -->
			<div class="welljq well-sm" id="btns"></div>
			<!-- grid -->
			<table id="grid-table"></table>
			<!-- 分页-->
			<div id="grid-pager"></div>
		</div>
	</div>
	
	<!-- 引入所需的js -->
	@include("/common/_listscript.html"){}
	
@}	